from django.urls import path
from django.http import Http404
from . import views

app_name = 'accounts'

# 隐藏所有dashboard路径 - 返回404
class HiddenDashboardView:
    @staticmethod
    def as_view():
        def view(request, *args, **kwargs):
            raise Http404("页面不存在")
        return view

urlpatterns = [
    # 隐藏dashboard相关路径
    path('dashboard/', HiddenDashboardView.as_view(), name='dashboard'),
    path('dashboard/test/', HiddenDashboardView.as_view(), name='dashboard_test'),
    path('dashboard/fixed/', HiddenDashboardView.as_view(), name='dashboard_fixed'),
    path('dashboard/simple/', HiddenDashboardView.as_view(), name='simple_dashboard'),
    path('dashboard/standalone/', HiddenDashboardView.as_view(), name='standalone_dashboard'),
    
    path('webhook/list/', views.simple_webhook_list, name='simple_webhook_list'),
    path('login/', views.user_login, name='login'),
    path('logout/', views.user_logout, name='logout'),
    # 用户个人资料编辑
    path('profile/edit/', views.profile_edit, name='profile_edit'),
    # 用户管理功能 - 仅超级管理员可访问
    path('users/', views.user_list, name='user_list'),
    path('users/create/', views.user_create, name='user_create'),
    path('users/<int:user_id>/edit/', views.user_edit, name='user_edit'),
    path('users/<int:user_id>/delete/', views.user_delete, name='user_delete'),
]